import java.sql.SQLOutput;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 安慕希
 * Date: 2025-02-27
 * Time: 16:20
 */
public class text {
    //1、逻辑短路与按位与、或
    public static void main1(String[] args) {
        System.out.println(10 < 20 & 10 > 11);
        System.out.println(10 < 20 | 10 > 11);
    }
    //2、逻辑非
    public static void main2(String[] args) {
        int a = 10;
        boolean flg = !(a == 10);
        System.out.println(flg);
    }
    //3、逻辑与、逻辑或
    public static void main3(String[] args) {
        int a = 10;
        int b = 20;
        int c = 30;
        System.out.println(a < b && a < c);//ture
        System.out.println(a > b && a < c);//false
        System.out.println(a < b && a > c);//false
        System.out.println(a > b && a > c);//false

        System.out.println(a < b || a < c);//ture
        System.out.println(a > b || a < c);//ture
        System.out.println(a < b || a > c);//ture
        System.out.println(a > b || a > c);//false

    }
    //4、Java中的true和false
    public static void main4(String[] args) {
        long a = 10l;
        long b = 20l;
        boolean flg = a == b;
        boolean flg1 = a < b;
        System.out.println(flg);
        System.out.println(flg1);
    }
    //5、前置++于后置++
    public static void main5(String[] args) {
        int a = 10;
        int b = a++;
        System.out.println("a="+ a + " b=" + b);
        int c = 10;
        int d = ++c;
        System.out.println("c="+ c + " d=" + d);
    }
    //6、+=以及涉及到的强制转换
    public static void main6(String[] args) {
        int a = 10;
        long b = 11l;
        a+= b;
        System.out.println(a + b);

        double c = 0.5;
        float d = 0.6f;
        c+= d;
        System.out.println(c);
        System.out.println(d);
    }
    //7、/以及%的运算
    public static void main7(String[] args) {
        double a =10.0;
        double b = -10.0;
        System.out.println(a %1.0);
        System.out.println(a %-1.0);
        System.out.println(b %-1.0);
        System.out.println(b %1.0);
        System.out.println(a /1.0);
        System.out.println(a /-1.0);
        System.out.println(b /-1.0);
        System.out.println(b /1.0);
        //%的时候，输出的结果与被除数的符号相同；但在/中，同数学的运算法则相同
    }
    //8、字符串转其他形式以及其他形式转字符串
    public static void main8(String[] args) {
        //字符串转换为整型
        String flg = "100";
        int a = Integer. parseInt(flg);
        System.out.println(a);
        //整形转化为字符串
        //方法1
        short b = 10;
        System.out.println(b +"");
        //方法2
        short c =20;
        String flg1 = String.valueOf(c);
        System.out.println(flg1);
    }
    //9、换行的几种形式
    public static void main9(String[] args) {
        System.out.println("你好");
        System.out.print("我是");
        System.out.printf("帅哥");
        System.out.printf("\n");
    }
    //10、字符串连写以及字符串与其他形式的连写
    public static void main10(String[] args) {
        String flg = "hhh";
        int a = 10;
        int b = 11;
        System.out.println(flg + a + b);
        System.out.println(flg + (a + b));
        System.out.println(a + b + flg);

    }
    //11、强制转换
    public static void main11(String[] args) {
        int a =8;
        long b = 20l;
        int c = (int)(a + b);
        System.out.println(c);
    }
    //12、打印不同形式的数据
    public static void main12(String[] args) {
        Boolean flg = true;
        System.out.println(flg);
        char a = 'A';
        char b = 65;
        double c = 20.11111111111111111111111;
        System.out.println(a+"\n"+b+"\n"+c);

    }
    //13、打印最大值和最小值
    public static void main13(String[] args) {
        long a = 10l;
        System.out.println(a);
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);

    }
}
